// Tooltips
$tooltip-color: #fff;//文字颜色
$tooltip-bg: #111;//背景色
$tooltip-max-width: 200px;//最大宽度
$tooltip-padding: 3px 8px;//左右补白
$tooltip-radius: 4px;//圆角
$tooltip-size: 12px;//背景色
$tooltip-arrow-color: #111;//箭头颜色
$tooltip-arrow-width: 4px;//箭头大小
$tooltip-zindex: 99;// zindex
.tooltip {
  position: absolute;
  z-index: $tooltip-zindex;
  display: block;
  font-size: $tooltip-size;
  opacity: 0;
  &.in{ 
    opacity: .8;
  }
  &.top{ 
    margin-top: -3px; 
    padding: $tooltip-arrow-width 0; 
  }
  &.right{ 
    margin-left: 3px;
    padding: 0 $tooltip-arrow-width; 
  }
  &.bottom{ 
    margin-top: 3px; 
    padding: $tooltip-arrow-width 0; 
  }
  &.left{ 
    margin-left: -3px; 
    padding: 0 $tooltip-arrow-width; 
  }
}
.tooltip-inner {
  max-width: $tooltip-max-width;
  padding: $tooltip-padding;
  color: $tooltip-color;
  text-align: center;
  background-color: $tooltip-bg;
  border-radius: $tooltip-radius;
}

// Arrows
.tooltip-arrow {
  position: absolute;
  width: 0;
  height: 0;
  border-color: transparent;
  border-style: solid;
}

.tooltip {
  &.top .tooltip-arrow {
    bottom: 0;
    left: 50%;
    margin-left: -$tooltip-arrow-width;
    border-width: $tooltip-arrow-width $tooltip-arrow-width 0;
    border-top-color: $tooltip-arrow-color;
  }
  &.top-left .tooltip-arrow {
    bottom: 0;
    right: $tooltip-arrow-width;
    margin-bottom: -$tooltip-arrow-width;
    border-width: $tooltip-arrow-width $tooltip-arrow-width 0;
    border-top-color: $tooltip-arrow-color;
  }
  &.top-right .tooltip-arrow {
    bottom: 0;
    left: $tooltip-arrow-width;
    margin-bottom: -$tooltip-arrow-width;
    border-width: $tooltip-arrow-width $tooltip-arrow-width 0;
    border-top-color: $tooltip-arrow-color;
  }
  &.right .tooltip-arrow {
    top: 50%;
    left: 0;
    margin-top: -$tooltip-arrow-width;
    border-width: $tooltip-arrow-width $tooltip-arrow-width $tooltip-arrow-width 0;
    border-right-color: $tooltip-arrow-color;
  }
  &.left .tooltip-arrow {
    top: 50%;
    right: 0;
    margin-top: -$tooltip-arrow-width;
    border-width: $tooltip-arrow-width 0 $tooltip-arrow-width $tooltip-arrow-width;
    border-left-color: $tooltip-arrow-color;
  }
  &.bottom .tooltip-arrow {
    top: 0;
    left: 50%;
    margin-left: -$tooltip-arrow-width;
    border-width: 0 $tooltip-arrow-width $tooltip-arrow-width;
    border-bottom-color: $tooltip-arrow-color;
  }
  &.bottom-left .tooltip-arrow {
    top: 0;
    right: $tooltip-arrow-width;
    margin-top: -$tooltip-arrow-width;
    border-width: 0 $tooltip-arrow-width $tooltip-arrow-width;
    border-bottom-color: $tooltip-arrow-color;
  }
  &.bottom-right .tooltip-arrow {
    top: 0;
    left: $tooltip-arrow-width;
    margin-top: -$tooltip-arrow-width;
    border-width: 0 $tooltip-arrow-width $tooltip-arrow-width;
    border-bottom-color: $tooltip-arrow-color;
  }
}
.fade {
  opacity: 0;
  -webkit-transition: opacity .3s linear;
       -o-transition: opacity .3s linear;
          transition: opacity .3s linear;
}
.fade.in {
  opacity: 1;
}